//index.js
//获取应用实例
const app = getApp()

Page({
  data: {
    motto: 'welcome',
    slider: [
      { pic: 'http://springmars.oss-cn-shanghai.aliyuncs.com/wechat/swiper/roll_1.jpg' },
      { pic: 'http://springmars.oss-cn-shanghai.aliyuncs.com/wechat/swiper/roll_2.jpg' },
      { pic: 'http://springmars.oss-cn-shanghai.aliyuncs.com/wechat/swiper/roll_3.jpg' }
    ],
    swiperCurrent: 0,
  },
  swiperChange: function (e) {
    this.setData({
      swiperCurrent: e.detail.current
    })
  },
  onLoad: function () {
    //system
    wx.getSystemInfo({
      success: function (res) {
        app.globalData.windowWidth = res.windowWidth,
        app.globalData.windowHeight = res.windowHeight
      }
    })
  },
})
